#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "liblive2d/Live2D.h"

#include <QMainWindow>

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow() override;

    //设置鼠标按下可移动窗口的区域，在子窗口中必须设置该区域
    void setAreaMovable(const QRect rt);

    bool eventFilter(QObject *obj, QEvent *event) override;
signals:

public slots:
    void createRightClickMenu(const QPoint &pos);

protected:
    void mousePressEvent(QMouseEvent *) override;
    void mouseMoveEvent(QMouseEvent *) override;
    void mouseReleaseEvent(QMouseEvent *) override;


private:
    Live2D *live2d = nullptr;

    QRect m_areaMovable;    //可移动窗口的区域，鼠标只有在该区域按下才能移动窗口
    bool m_bPressed;        //鼠标按下标志（不分左右键）
    QPoint m_ptPress;       //鼠标按下的初始位置

};

#endif // MAINWINDOW_H
